home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / vol7n9.arc / EXTENDED.PAS < prev    next >
Pascal/Delphi Source File  |  1988-04-08  |  956b  |  28 lines

  1.   FUNCTION Is_Extended : Boolean;
  2.   TYPE
  3.     Registers = RECORD
  4.                   CASE Integer OF
  5.                     1 : (AX, BX, CX, DX, BP, SI, DI, DS, ES, Flags : Integer);
  6.                     2 : (AL, AH, BL, BH, CL, CH, DL, DH : Byte);
  7.                 END;
  8.   VAR
  9.     R : registers;
  10.     Shift_State : Byte ABSOLUTE $40 : $17;
  11.   BEGIN
  12.     (*READ the current shift states using EXTENDED BIOS function*)
  13.     R.AH := $12;
  14.     Intr($16, R);
  15.     (*IF the result is the same as the shift state byte, *)
  16.     (*it's _probably_ an extended BIOS.     To be sure...*)
  17.     IF R.AL <> Shift_State THEN Is_Extended := False
  18.     ELSE
  19.       BEGIN
  20.         (*... we toggle the INSERT bit in the flag...*)
  21.         Shift_State := Shift_State XOR $80;
  22.         R.AH := $12;
  23.         Intr($16, R);
  24.         (*...and read the shift state again.*)
  25.         Is_Extended := R.AL = Shift_State;
  26.         Shift_State := Shift_State XOR $80;
  27.       END;
  28.   END;